package bishi.kaizi;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * @author: Tangxz
 * @email: 1171702529@qq.com
 * @cate: 2022/03/13 20:46
 */
public class _07 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int M = sc.nextInt();
        int N = sc.nextInt();
        int K = sc.nextInt();
        Set<Integer> stones = new HashSet<>();
        for (int i = 0; i < K; i++) {
            int x = sc.nextInt();
            int y = sc.nextInt();
            stones.add(x * 100000 + y);
        }
        int[] now = new int[N + 1];
        for (int i = 1; i <= N; i++) {
            if (stones.contains(i)) {
                break;
            } else {
                now[i] = 1;
            }
        }
        for (int i = 2; i <= M; i++) {
            for (int j = 1; j <= N ; j++) {
                if (stones.contains(i * 100000 + j)) {
                    now[j] = 0;
                } else {
                    now[j] = (now[j - 1] + now[j]) % (1000000007);
                }
            }
        }
        System.out.println(now[N]);
    }
}